package com.hnit.rol.model.entity.order;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author King
 * @since 2023-04-08
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("order_info")
@ApiModel(value = "OrderInfo对象", description = "")
public class OrderInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("订单id")
    private Long orderId;

    @ApiModelProperty("购买id(对应展示书的id)")
    private Long purchaseId;

    @ApiModelProperty("用户id")
    private Long userId;

    @ApiModelProperty("购买书的数量")
    private Integer bookNum;

    @ApiModelProperty("订单价格")
    private BigDecimal orderPrice;

    @ApiModelProperty("订单类型（1-上门取件 2-送货上门）")
    private Integer orderType;

    @ApiModelProperty("用户地址")
    private String userAddress;

    @ApiModelProperty("下单时间")
    private LocalDateTime orderTime;

    @ApiModelProperty("取消/完成时间")
    private LocalDateTime finishTime;

    @ApiModelProperty("订单状态（0-取消 1-未完成 2-已完成 3-未下单）")
    private Integer orderStatus;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("修改时间")
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

}
